#include "Astronomy/Coordinate.hpp"
#include "Astronomy/Transformation.hpp"

Coordinate2D Coordinate2D::RadiansToDegrees()
{
    Coordinate2D ToDegrees{};
    ToDegrees.X = Transformation::RadiansToDegrees(this->X);
    ToDegrees.Y = Transformation::RadiansToDegrees(this->Y);
    return ToDegrees;
}

Coordinate3D Coordinate3D::RadiansToDegrees() noexcept
{
    Coordinate3D ToDegrees{};
    ToDegrees.X = Transformation::RadiansToDegrees(this->X);
    ToDegrees.Y = Transformation::RadiansToDegrees(this->Y);
    ToDegrees.Z = Transformation::RadiansToDegrees(this->Z);
    return ToDegrees;
}

void Coordinate3D::EclipticToEquatorial(const double Epsilon) noexcept
{
    {
        Coordinate3D Equatorial{ *this };

        Equatorial = Transformation::EclipticEquatorial(this->X, this->Y, Epsilon);
        Equatorial.X = Transformation::MapTo0To2PIRange(Equatorial.X);

        this->X = Equatorial.X;
        this->Y = Equatorial.Y;
        this->Z = Equatorial.Z;

        //return Equatorial;
    }
}
